package com.tuling.mall.user.ribbon.config;

import com.alibaba.cloud.nacos.ribbon.NacosRule;
import com.netflix.loadbalancer.IRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RibbonConfig {

    /**
     * 全局配置，指定负载均衡策略
     */
    @Bean
    public IRule rule(){
        // 使用nacos提供的负载均衡策略
        return new NacosRule();
    }
}
